public class test1 {
    class Solution {
        public int combinationSum4(int[] nums, int target) {
            //排列:与顺序有关，外背包内物品
            //组合：+=
            //完全背包：正序
            int[] dp = new int[target+1];
            dp[0] = 1;
            for(int j = 0;j<=target;j++){
                for(int i = 0;i<nums.length;i++){
                    if(j>=nums[i]){
                        dp[j] += dp[j-nums[i]];
                    }
                }
            }
            return dp[target];
        }
    }
}
